package net.lahuobao.mall.service.impl.admin;

import net.lahuobao.mall.entity.admin.MallProjectUpdateLogEntity;
import net.lahuobao.mall.service.admin.MallProjectUpdateLogServiceI;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/3/30.
 * 项目人员更改记录表
 */
@Service
public class MallProjectUpdateLogServiceImpl extends CommonServiceImpl implements MallProjectUpdateLogServiceI {

    /**
     * 根据油卡卡号查询变更记录
     * @param cardNo
     * @return
     */
    @Override
    public List<MallProjectUpdateLogEntity> selectByOilCardNo(String cardNo) {
        String hql = " from MallProjectUpdateLogEntity  where logtype = 2 and cardno = ?" ;
        List<MallProjectUpdateLogEntity> temp = super.findHql(hql, cardNo);
        List<MallProjectUpdateLogEntity> result = new ArrayList<MallProjectUpdateLogEntity>();
        for(MallProjectUpdateLogEntity log : temp){
            result.add(super.get(MallProjectUpdateLogEntity.class, log.getId()));
        }
        return result;
    }
}
